package com.hzit.manager.client.factory;

import com.hzit.manager.client.UserClient;
import com.ruoyi.common.core.domain.R;
import feign.Feign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Component
@Slf4j
public class HzitFeignCallbackFactory implements FallbackFactory<UserClient> {
	@Override
	public UserClient create(Throwable e) {
		return new UserClient() {
			@Override
			public R add() {
				log.error("调用hzit-user服务失败！");
				return R.fail(500,"服务调用失败！");
			}
		};
	}
}
